<template>

</template>

<script lang="ts" setup>
const bookArr = [
  { id: 1, bookName: "三国演义" },
  { id: 2, bookName: "水浒传" },
  { id: 3, bookName: "红楼梦" },
  { id: 4, bookName: "西游记" }
];
const targetBook = bookArr.find(book => book.id === 3);

// 输出bookName
if (targetBook) {
  console.log(targetBook.bookName); // 输出：红楼梦
}
</script>

<style>

</style>
